// components/amount/index.js
import { dumpFunc } from "@src/common/dump";
import dayjs from "dayjs";
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    IconAD: {
      type: Array,
    },
    login: {
      type: Boolean,
    },
    module: {
      type: Object,
    },
  },
  options: {
    addGlobalClass: true,
  },

  lifetimes: {
    attached: function () {
      this.setData({
        config: JSON.parse(this.data.module.dump.insideParams).config,
      });
    },
  },
  /**
   * 组件的初始数据
   */
  data: {
    config: {},
  },
  /**
   * 组件的方法列表
   */
  methods: {
    jumpPage(e) {
      console.log("点击跳转", this.data.config);
      let { dump, biz, title } = e.currentTarget.dataset.item;

      if (!this.data.login && dump.path !== "pages/indexChooseCard/main") {
        this.triggerEvent("login");
        return;
      }
      dumpFunc({ ...dump, title }, biz);
    },
  },
});
